<?xml version="1.0" encoding="UTF-8"?>

<configuration scan="true" scanPeriod="60 seconds">
    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
        </encoder>
    </appender>
    <appender name="springboot"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- <Encoding>UTF-8</Encoding> -->
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>logs/logback/springboot_%d{yyyy-M-d}.log
            </FileNamePattern>
            <MaxHistory>10</MaxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
        </encoder>
    </appender>
    <appender name="smile"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>logs/logback/smile_%d{yyyy-M-d}.log
            </FileNamePattern>
            <MaxHistory>10</MaxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
        </encoder>
    </appender>

    <logger name="org.springframework.boot" level="debug"
            additivity="false">
        <appender-ref ref="springboot" />
    </logger>
    <!-- name包必须能够扫描到所以类，包括启动类 -->
    <logger level="debug" additivity="false" name="${projectRootPackage}">
        <appender-ref ref="smile" />
        <appender-ref ref="stdout" />
    </logger>
    <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" ><appender-ref ref="stdout"/></logger>
    <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG"  ><appender-ref ref="stdout"/></logger>
    <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG"  ><appender-ref ref="stdout"/></logger>
    <logger name="java.sql.Connection" level="DEBUG"  ><appender-ref ref="stdout"/></logger>
    <logger name="java.sql.Statement" level="DEBUG"  ><appender-ref ref="stdout"/></logger>
    <logger name="java.sql.PreparedStatement" level="DEBUG"  ><appender-ref ref="stdout"/></logger>

    <root level="info">
        <appender-ref ref="stdout" />
    </root>
</configuration>